package com.example.tass.domain;

import cn.tass.SRJ1933.devices.utis.StringUtils;
import cn.tass.exceptions.TAException;
import cn.tass.logger.Logger;

public class SignRequest extends MyBaseRequest{

    private String keyId;   // 签名使用的非对称密钥唯一标识，可为非对称密钥标识名、非对称密钥DN，具体是那种通过参数keyIdType指定。
    private int keyIdType;  // 该参数指示keyId内容类型，可选值：0： 表示keyId为非对称密钥标识名（默认值）1： 表示keyId为非对称密钥DN，DN信息必须进行Base64编码
    private String keyAccessCode;   // 签名使用的非对称密钥访问控制码，如果指定的密钥后台未设置访问控制码则可不填，否则必须填入密钥对应访问控制码
    private String algorithm;
    private String data;
    private int dataType;
    private String sm2UserID;
    private int rsaPadMode;
    private boolean checkCert;
    private Integer signFormat;

    public SignRequest() {
    }

    public void setKeyId(String keyId) {
        this.keyId = keyId;
    }

    public void setKeyIdType(Integer keyIdType) {
        this.keyIdType = keyIdType;
    }

    public void setKeyAccessCode(String keyAccessCode) {
        this.keyAccessCode = keyAccessCode;
    }

    public void setAlgorithm(String algorithm) {
        this.algorithm = algorithm;
    }

    public void setData(String data) {
        this.data = data;
    }

    public void setDataType(Integer dataType) {
        this.dataType = dataType;
    }

    public void setSm2UserID(String sm2UserID) {
        this.sm2UserID = sm2UserID;
    }

    public void setRsaPadMode(Integer rsaPadMode) {
        this.rsaPadMode = rsaPadMode;
    }

    public void setCheckCert(boolean checkCert) {
        this.checkCert = checkCert;
    }

    public void setSignFormat(Integer signFormat) {
        this.signFormat = signFormat;
    }

    public void validate() throws TAException {
        this.checkParamIsEmpty(this.keyId, "keyId");
        this.checkParamIsEmpty(this.data, "data");
    }

    public String getKeyId() {
        return this.keyId;
    }

    public Integer getKeyIdType() {
        return this.keyIdType;
    }

    public String getKeyAccessCode() {
        return this.keyAccessCode;
    }

    public String getAlgorithm() {
        return this.algorithm;
    }

    public String getData() {
        return this.data;
    }

    public Integer getDataType() {
        return this.dataType;
    }

    public String getSm2UserID() {
        return this.sm2UserID;
    }

    public Integer getRsaPadMode() {
        return this.rsaPadMode;
    }

    public boolean isCheckCert() {
        return this.checkCert;
    }

    public Integer getSignFormat() {
        return this.signFormat;
    }
    
}
